<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:h="http://java.sun.com/jsf/html"	
	  xmlns:p="http://primefaces.org/ui">

	  <ui:composition template="template.xhtml">
		<ui:define name="tituloPaginas">INVISTA</ui:define>
		<ui:define name="corpoPagina">
		
	  	<h:form id="formulario_cadastro_produto" prependId="false">
	  		<h:messages />
	  		
	  		<h:panelGrid column="2">
	  			<f:facet name="header">Cadastro de Conta Bancária</f:facet>
	  			<f:facet name="footer">
	  				<div align="center">
	  					<p:commandButton value="Salvar" action="#{contaBancariaController.salvar()}" />
	  					<p:commandButton value="Cancelar" action="#{contaBancariaController.cancelar()}" />
	  				</div>
	  			</f:facet>
				
				<p:outputLabel value="Pessoa"/>
				 <p:selectOneMenu value="#{contaBancariaController.contaBancaria.pessoa}" converter="pessoaConverter">
                 	<f:selectItem itemLabel="Selecione" noSelectionOption="true" />
                    	<f:selectItems value="#{pessoaController.pessoaDao.listarPessoas}"
                    	               var="pessoa"
                    	               itemValue="#{pessoa}"
                    	               itemLabel="#{pessoa.nome}" />
                 </p:selectOneMenu>	
                 
                 <p:outputLabel value="Tipo da Conta"/>
				 <p:selectOneMenu value="#{contaBancariaController.contaBancaria.tipoConta}">
                 	<f:selectItem itemLabel="Selecione" noSelectionOption="true" />
                    	<f:selectItems value="#{contaBancariaController.listarTipoConta()}"
                    	               var="tipoConta"
                    	               itemValue="#{tipoConta}"
                    	               itemLabel="#{tipoConta.descricao}" />
                 </p:selectOneMenu>
                
                <p:outputLabel value="Númeor da Agência"/>
				<p:inputText value="#{contaBancariaController.contaBancaria.numeroAgencia}" maxlength="10" size="5" readonly="false" />
				
				<p:outputLabel value="Númeoro da Conta"/>
				<p:inputText value="#{contaBancariaController.contaBancaria.numeroConta}" maxlength="10" size="5" readonly="false" />
                 
                 <p:outputLabel value="Moeda"/>
				 <p:selectOneMenu value="#{contaBancariaController.contaBancaria.moeda}">
                 	<f:selectItem itemLabel="Selecione" noSelectionOption="true" />
                    	<f:selectItems value="#{contaBancariaController.listarTipoMoeda()}"
                    	               var="tipoModeda"
                    	               itemValue="#{tipoModeda}"
                    	               itemLabel="#{tipoModeda.descricao}" />
                 </p:selectOneMenu>
                 
                <p:outputLabel value="Saldo Atual"/>
				<p:inputText value="#{contaBancariaController.contaBancaria.saldoAtual}" maxlength="10" size="5" readonly="false" />
				
				<p:outputLabel value="Ativo"/>
				 <p:selectOneMenu id="selectAtivo" value="#{contaBancariaController.contaBancaria.ativo}">
                 	<f:selectItem itemLabel="Selecione" noSelectionOption="true" />
                    	<f:selectItems value="#{contaBancariaController.listarTipoAtivo()}" 
                    	               var="tipoAtivoInativo" 
                    	               itemValue="#{tipoAtivoInativo}" 
                    	               itemLabel="#{tipoAtivoInativo.descricao}"  />
                 </p:selectOneMenu>
                 
	  		</h:panelGrid>
				  		
	  	</h:form>
		</ui:define>
	  </ui:composition>

</html>

